/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.funda.xmppserver.handlers.iqhandlers;

import com.funda.xmppserver.ComponentParser;
import com.funda.xmppserver.XMPPClient;
import com.funda.xmppserver.writer.XMPPPacketWriter;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;

/**
 *
 * @author kurinchi
 */
public class IQSessionHandler implements ComponentParser{

    XMPPPacketWriter packetwriter;
    XMPPClient client;
    Connection conn;
    Statement smt;
    ResultSet rs;
    Boolean valid = true;
    String id;
    String type;

    public IQSessionHandler(XMPPPacketWriter packetwriter, XMPPClient client, String id, String type) {
        this.packetwriter = packetwriter;
        this.client = client;
        this.id = id;
        this.type = type;

    }

    public void parseElement(XMLStreamReader xmlReader) throws XMLStreamException {
        System.out.println("IQSession Handler...");

        if(xmlReader.getNamespaceURI(0).equalsIgnoreCase("urn:ietf:params:xml:ns:xmpp-session"))
        {
            packetwriter.sendsessionResponse(id);
        }
    }



}
